using MicroMsg.Common.Utils;
using MicroMsg.Manager;
using MicroMsg.Protocol;
using MicroMsg.Resource.@string;
using MicroMsg.Storage;
using MicroMsg.UI.UserContrl;
using MicroMsg.UI.Util;
using System;
using System.Globalization;
using System.Windows.Media.Imaging;
namespace MicroMsg.Plugin.TXBlogRead
{
	public class TXBlogRead : PluginBase
	{
		private const string TAG = "TXBlogRead";
		public const string PluginKey = "Plugin TXBlogRead";
		public const long PluginID = 32784L;
		public const string PluginName = "TXBlogRead";
		public const int PluginVersion = 256;
		private static TXBlogRead mInstance;
		public override string mTitle
		{
			get
			{
				return strings.Contacts_Plugin_Blog;
			}
		}
		public override BitmapSource mIcon
		{
			get
			{
				return ImageCacheMgr.loadFromRes("Source/Plugin/TXBlogRead/Resource/Img/icon.png");
			}
		}
		public override BitmapSource mIconHD
		{
			get
			{
				return HeadImgMgr.getHeadImage(ConstantValue.TAG_BLOGAPP, true);
			}
		}
		public override BitmapSource mIconInList
		{
			get
			{
				return this.mIcon;
			}
		}
		public override string mDescription
		{
			get
			{
				return strings.Contacts_Intro_BlogApp;
			}
		}
		public override string mAuthor
		{
			get
			{
				return "tencent";
			}
		}
		public TXBlogRead()
		{
			this.mKey = "Plugin TXBlogRead";
			this.mID = 32784L;
			this.mName = "TXBlogRead";
			this.mUserName = ConstantValue.TAG_BLOGAPP;
			this.mVersion = 256;
			this.mIndexInTab = (MainTabIndex)3;
			this.mIndexInGroup = 2;
			this.mIndexInPosition = 0;
			this.mProtocolPluginFlag = EPluginFlag.MM_BLOG_UNINSTALL;
			this.mDefaultInstalled = true;
			TXBlogRead.mInstance = this;
			if (AccountMgr.getCurAccount().nBindQQ <= 0u)
			{
				RegionInfo currentRegion = RegionInfo.get_CurrentRegion();
				if (currentRegion.get_Name() != "CN")
				{
					this.mEnabled = false;
					this.mDefaultInstalled = false;
				}
			}
		}
		public override PluginSettingBaseCtrl GetPluginSettingCtrl()
		{
			return new TXBlogReadPluginSetCtrl();
		}
		public static TXBlogRead getInstance()
		{
			return TXBlogRead.mInstance;
		}
		public override void onRegisterResult(RetConst retConst_0, int code)
		{
			Log.smethod_4("TXBlogRead", string.Concat(new object[]
			{
				"on register result , ret = ",
				retConst_0,
				", code = ",
				code
			}));
		}
		public override bool onInitialize()
		{
			Log.smethod_4("TXBlogRead", "initialize. ");
			return true;
		}
		public override bool onInstalled(InstallMode mode)
		{
			Log.smethod_4("TXBlogRead", "on inistalled. ");
			return true;
		}
		public override bool onUninstalled(InstallMode mode)
		{
			Log.smethod_4("TXBlogRead", "on uninstalled. ");
			BlogConversationMgr.clearAllMsg();
			return true;
		}
		public override bool onParseChatMsg(ChatMsg chatMsg)
		{
			return false;
		}
		public override object execute(int entryType, object args)
		{
			Log.smethod_4("TXBlogRead", "plugin execute,   entrytype =" + entryType);
			if (entryType == 2)
			{
				ToolFunction.GotoPageForUserControl("/Source/Plugin/TXBlogRead/UI/TXBlogReadView.xaml", null, false);
			}
			return null;
		}
	}
}
